import { defineNuxtPlugin } from "#app";

export default defineNuxtPlugin((nuxtApp) => {
  // 封装跳转方法
  const $navigate = (path: any, isReplace: Boolean) => {
    const router = useRouter();
    const localePath = useLocalePath();
    if(isReplace) {
        router.replace(localePath(path));
    }else {
        router.push(localePath(path));
    }
  };
  nuxtApp.provide("navigate", $navigate);
});
